<?php


class SpecialPhotoTable extends Doctrine_Table
{
    
    public static function getInstance()
    {
        return Doctrine_Core::getTable('SpecialPhoto');
    }
	public function getPhotoBySpecial($special,$max)
    {
		$q = Doctrine_Query::create()
			->from('SpecialPhoto sp')
			->where('sp.special_id =?',$special)
			->orderBy('id desc')
			->limit($max);
		return $q->execute();
    }
}